package cn.enilu.flash.bean.entity.shop;

import cn.enilu.flash.bean.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Data;
import net.bytebuddy.build.HashCodeAndEqualsPlugin;
import org.hibernate.annotations.SortComparator;
import org.hibernate.annotations.Table;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;


@Data
@Entity(name="t_shop_laber_goods")
@Table(appliesTo = "t_shop_laber_goods")
public class LabelGoods extends BaseEntity {
    @Column(name="label_id")
    private Long labelId;
    @JoinColumn(name="label_id", insertable = false, updatable = false,foreignKey = @ForeignKey(name="none",value = ConstraintMode.NO_CONSTRAINT))
    @OneToOne(fetch = FetchType.LAZY)
    @JsonBackReference
    private Label label;
    @Column(name="goods_id")
    private Long goodsId;
    @JoinColumn(name="goods_id", insertable = false, updatable = false,foreignKey = @ForeignKey(name="none",value = ConstraintMode.NO_CONSTRAINT))
    @OneToOne(fetch = FetchType.LAZY)
    private Goods goods;
}
